home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
prog
/
iconp.zip
/
TRIM.ICN
< prev
Wrap
Text File
|
1987-05-29
|
475b
|
27 lines
# TRIM(1)
#
# Trim lines
#
# Ralph E. Griswold
#
# Last modified 7/10/83
#
procedure main(x)
local n, i, pad, s, line
n := 80
pad := 0
i := 0
while i < *x do {
s := x[i +:= 1] | break
if s == "-f" then pad := 1
else if not(n := (0 <= integer(s))) then stop("usage: trim [n] [-f]")
}
while line := read() do {
line := line[1+:n]
line := trim(line)
if pad = 1 then line := left(line,n)
write(line)
}
end